/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package exemplointerface;

import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author Aluno
 */
public class InterfaceAtor extends javax.swing.JFrame {

    /**
     * Creates new form InterfaceAtor
     */
    List<Ator> lista;
    Integer posicao, aux;
    Double total;
    public InterfaceAtor() {
        initComponents();
        lista = new ArrayList<Ator>();
        posicao = 0;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        textNome = new javax.swing.JTextField();
        textData = new javax.swing.JTextField();
        textQtdNovela = new javax.swing.JTextField();
        textEmail = new javax.swing.JTextField();
        textNomeArt = new javax.swing.JTextField();
        textSalario = new javax.swing.JTextField();
        textCache = new javax.swing.JTextField();
        textCidade = new javax.swing.JTextField();
        textBairro = new javax.swing.JTextField();
        textEndereco = new javax.swing.JTextField();
        selecaoEstado = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        textQtdEvento = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        bPrimeiro = new javax.swing.JButton();
        bAnterior = new javax.swing.JButton();
        bProximo = new javax.swing.JButton();
        bUltimo = new javax.swing.JButton();
        textGanhos = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        bCadastrar = new javax.swing.JButton();
        botaoLimpar = new javax.swing.JButton();
        bConsultar = new javax.swing.JButton();
        bExcluir = new javax.swing.JButton();
        bStatus = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(204, 204, 204));

        jLabel1.setBackground(new java.awt.Color(204, 255, 204));
        jLabel1.setFont(new java.awt.Font("Gabriola", 1, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 0, 102));
        jLabel1.setText("Informações Sobre Ator");

        jLabel2.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(0, 0, 153));
        jLabel2.setText("Nome:");

        jLabel3.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(0, 0, 153));
        jLabel3.setText("Data de Nascimento:");

        jLabel4.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(0, 0, 153));
        jLabel4.setText("Quantidade de novelas: ");

        jLabel5.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(0, 0, 153));
        jLabel5.setText("Email:");

        jLabel6.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(0, 0, 153));
        jLabel6.setText("Nome Artístico:");

        jLabel7.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(0, 0, 153));
        jLabel7.setText("Salário:");

        jLabel8.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(0, 0, 153));
        jLabel8.setText("Cachê:");

        jLabel9.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(0, 0, 153));
        jLabel9.setText("Estado:");

        jLabel10.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(0, 0, 153));
        jLabel10.setText("Cidade:");

        jLabel11.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(0, 0, 153));
        jLabel11.setText("Bairro:");

        jLabel12.setFont(new java.awt.Font("Gabriola", 0, 16)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(0, 0, 153));
        jLabel12.setText("Endereço:");

        selecaoEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione", "RS", "SC", "PR", "SP", "MG", "MT" }));
        selecaoEstado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selecaoEstadoActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Gabriola", 0, 14)); // NOI18N
        jLabel13.setForeground(new java.awt.Color(51, 0, 153));
        jLabel13.setText("GANHOS:");

        jLabel14.setFont(new java.awt.Font("Gabriola", 0, 15)); // NOI18N
        jLabel14.setForeground(new java.awt.Color(51, 0, 153));
        jLabel14.setText("Quantidade de Eventos:");

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 102)), "Navegação", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Gabriola", 3, 16), new java.awt.Color(0, 0, 102))); // NOI18N
        jPanel1.setForeground(new java.awt.Color(0, 0, 102));
        jPanel1.setToolTipText("Navegação");
        jPanel1.setName("Navegação"); // NOI18N

        bPrimeiro.setBackground(new java.awt.Color(102, 102, 255));
        bPrimeiro.setFont(new java.awt.Font("Gabriola", 1, 14)); // NOI18N
        bPrimeiro.setForeground(new java.awt.Color(0, 0, 102));
        bPrimeiro.setText("Primeiro");
        bPrimeiro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bPrimeiroActionPerformed(evt);
            }
        });

        bAnterior.setBackground(new java.awt.Color(102, 102, 255));
        bAnterior.setFont(new java.awt.Font("Gabriola", 3, 14)); // NOI18N
        bAnterior.setForeground(new java.awt.Color(0, 0, 102));
        bAnterior.setText("Anterior");
        bAnterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAnteriorActionPerformed(evt);
            }
        });

        bProximo.setBackground(new java.awt.Color(102, 102, 255));
        bProximo.setFont(new java.awt.Font("Gabriola", 1, 14)); // NOI18N
        bProximo.setForeground(new java.awt.Color(0, 0, 102));
        bProximo.setText("Próximo");
        bProximo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bProximoActionPerformed(evt);
            }
        });

        bUltimo.setBackground(new java.awt.Color(102, 102, 255));
        bUltimo.setFont(new java.awt.Font("Gabriola", 3, 14)); // NOI18N
        bUltimo.setForeground(new java.awt.Color(0, 0, 102));
        bUltimo.setText("Último");
        bUltimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bUltimoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(bPrimeiro)
                .addGap(32, 32, 32)
                .addComponent(bAnterior)
                .addGap(38, 38, 38)
                .addComponent(bProximo)
                .addGap(43, 43, 43)
                .addComponent(bUltimo)
                .addContainerGap(54, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bPrimeiro)
                    .addComponent(bAnterior)
                    .addComponent(bProximo)
                    .addComponent(bUltimo))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        textGanhos.setBackground(new java.awt.Color(51, 0, 102));
        textGanhos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51, 0, 102)));

        jPanel2.setBackground(new java.awt.Color(204, 204, 204));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 102)), "Ação", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Gabriola", 3, 16), new java.awt.Color(0, 0, 102))); // NOI18N

        bCadastrar.setBackground(new java.awt.Color(102, 102, 255));
        bCadastrar.setFont(new java.awt.Font("Gabriola", 1, 12)); // NOI18N
        bCadastrar.setText("Cadastrar");
        bCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bCadastrarActionPerformed(evt);
            }
        });

        botaoLimpar.setBackground(new java.awt.Color(102, 102, 255));
        botaoLimpar.setFont(new java.awt.Font("Gabriola", 1, 14)); // NOI18N
        botaoLimpar.setText("Limpar");
        botaoLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoLimparActionPerformed(evt);
            }
        });

        bConsultar.setBackground(new java.awt.Color(102, 102, 255));
        bConsultar.setFont(new java.awt.Font("Gabriola", 1, 14)); // NOI18N
        bConsultar.setText("Consultar");
        bConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bConsultarActionPerformed(evt);
            }
        });

        bExcluir.setBackground(new java.awt.Color(102, 102, 255));
        bExcluir.setFont(new java.awt.Font("Gabriola", 1, 13)); // NOI18N
        bExcluir.setText("Excluir");
        bExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bExcluirActionPerformed(evt);
            }
        });

        bStatus.setBackground(new java.awt.Color(102, 102, 255));
        bStatus.setFont(new java.awt.Font("Gabriola", 1, 14)); // NOI18N
        bStatus.setText("Status");
        bStatus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bStatusActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(bCadastrar)
                .addGap(18, 18, 18)
                .addComponent(botaoLimpar, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(bConsultar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(bExcluir)
                .addGap(18, 18, 18)
                .addComponent(bStatus)
                .addContainerGap(15, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(bCadastrar)
                        .addComponent(botaoLimpar, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(bConsultar, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(bExcluir))
                    .addComponent(bStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(32, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(86, 86, 86)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(233, 233, 233)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(58, 58, 58)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel2))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(textNome, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(textData, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(textEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(textQtdNovela, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(textNomeArt, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(textSalario, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(textCache, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(selecaoEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                .addGap(36, 36, 36)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(textQtdEvento, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel13)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(textGanhos, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel11)
                                            .addComponent(jLabel12)
                                            .addComponent(jLabel10))
                                        .addGap(18, 18, 18)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(textCidade, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                                            .addComponent(textEndereco, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                                            .addComponent(textBairro, javax.swing.GroupLayout.Alignment.LEADING))))))))
                .addContainerGap(79, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(11, 11, 11)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(textNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(textCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(textData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(textBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(9, 9, 9))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel4)
                                .addComponent(textQtdNovela, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(textEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel12)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(textEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel14)
                            .addComponent(textQtdEvento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textGanhos, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel6)
                                .addComponent(textNomeArt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel13)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textSalario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(16, 16, 16)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(textCache, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(selecaoEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void selecaoEstadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selecaoEstadoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_selecaoEstadoActionPerformed

    private void botaoLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoLimparActionPerformed
        // TODO add your handling code here:
        Limpar();
                
    }//GEN-LAST:event_botaoLimparActionPerformed

    private void bCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bCadastrarActionPerformed
        // TODO add your handling code here:
        Ator obj = new Ator();
        
        obj.setNome(textNome.getText());
        obj.setNascimento(textData.getText());
        obj.setEmail(textEmail.getText());
        obj.setNomea(textNomeArt.getText());
        obj.setEstado(selecaoEstado.getSelectedItem().toString());
        obj.setCidade(textCidade.getText());
        obj.setBairro(textBairro.getText());
        obj.setEndereco(textEndereco.getText());
        obj.setQtdnovela(Integer.parseInt(textQtdNovela.getText()));
        obj.setSalariom(Double.parseDouble(textSalario.getText()));
        obj.setCacheev(Double.parseDouble(textCache.getText()));
        
        aux = (Integer.parseInt(textQtdEvento.getText()));
        total = (Double.parseDouble(textSalario.getText())) + (aux*(Double.parseDouble(textCache.getText())));
                
        if(textNome.getText().equals("") || textData.getText().equals("") || textEmail.getText().equals("") || textNomeArt.getText().equals("") ||
           selecaoEstado.getSelectedIndex() == 0 || textCidade.getText().equals("") || textBairro.getText().equals("") || textEndereco.getText().equals("") 
        ||textQtdNovela.getText().equals("") || textSalario.getText().equals("") || textCache.getText().equals("") || textQtdEvento.getText().equals("")){
            JOptionPane.showMessageDialog(null, "Complete todas as lacunas..");
        }else{
            textGanhos.setText(total.toString());
            lista.add(obj);
            JOptionPane.showMessageDialog(null, "Ator Cadastrado");
        }
        Limpar(); 
    }//GEN-LAST:event_bCadastrarActionPerformed

    private void bExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bExcluirActionPerformed
        // TODO add your handling code here:
        lista.remove(lista.get(posicao));
        Limpar();
    }//GEN-LAST:event_bExcluirActionPerformed

    private void bPrimeiroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bPrimeiroActionPerformed
        // TODO add your handling code here:
        posicao = 0;
        Ator a = lista.get(0);
        textNome.setText(a.getNome());
        textData.setText(a.getNascimento());
        textEmail.setText(a.getEmail());
        textNomeArt.setText(a.getNomea());
        selecaoEstado.setSelectedItem(a.getEstado());
        textCidade.setText(a.getCidade());
        textBairro.setText(a.getBairro());
        textEndereco.setText(a.getEndereco());
        textQtdNovela.setText(a.getQtdnovela().toString());
        textSalario.setText(a.getSalariom().toString());
        textCache.setText(a.getCacheev().toString());
       
        textGanhos.setText(a.calcularGanhos(1).toString());
        
        
    }//GEN-LAST:event_bPrimeiroActionPerformed

    private void bAnteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAnteriorActionPerformed
        // TODO add your handling code here:
        if (posicao > 0){
            posicao = posicao -1;
            Ator a = lista.get(posicao);
            textNome.setText(a.getNome());
            textData.setText(a.getNascimento());
            textEmail.setText(a.getEmail());
            textNomeArt.setText(a.getNomea());
            selecaoEstado.setSelectedItem(a.getEstado());
            textCidade.setText(a.getCidade());
            textBairro.setText(a.getBairro());
            textEndereco.setText(a.getEndereco());
            textQtdNovela.setText(a.getQtdnovela().toString());
            textSalario.setText(a.getSalariom().toString());
            textCache.setText(a.getCacheev().toString());
            textQtdEvento.setText(aux.toString());
            textGanhos.setText(total.toString());
            
        }
    }//GEN-LAST:event_bAnteriorActionPerformed

    private void bProximoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bProximoActionPerformed
        // TODO add your handling code here:
        if(posicao < lista.size()){
            posicao = posicao + 1;
            Ator a = lista.get(posicao);
            textNome.setText(a.getNome());
            textData.setText(a.getNascimento());
            textEmail.setText(a.getEmail());
            textNomeArt.setText(a.getNomea());
            selecaoEstado.setSelectedItem(a.getEstado());
            textCidade.setText(a.getCidade());
            textBairro.setText(a.getBairro());
            textEndereco.setText(a.getEndereco());
            textQtdNovela.setText(a.getQtdnovela().toString());
            textSalario.setText(a.getSalariom().toString());
            textCache.setText(a.getCacheev().toString());
            textQtdEvento.setText(aux.toString());
            textGanhos.setText(total.toString());
        }
    }//GEN-LAST:event_bProximoActionPerformed

    private void bUltimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bUltimoActionPerformed
        
            posicao = lista.size();
            Ator a = lista.get(posicao-1);
            textNome.setText(a.getNome());
            textData.setText(a.getNascimento());
            textEmail.setText(a.getEmail());
            textNomeArt.setText(a.getNomea());
            selecaoEstado.setSelectedItem(a.getEstado());
            textCidade.setText(a.getCidade());
            textBairro.setText(a.getBairro());
            textEndereco.setText(a.getEndereco());
            textQtdNovela.setText(a.getQtdnovela().toString());
            textSalario.setText(a.getSalariom().toString());
            textCache.setText(a.getCacheev().toString());
            textQtdEvento.setText(aux.toString());
            textGanhos.setText(total.toString());
        
    }//GEN-LAST:event_bUltimoActionPerformed

    private void bConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bConsultarActionPerformed
        // TODO add your handling code here:
        String nome = JOptionPane.showInputDialog("Digite o nome a ser pesquisado: ");
        Boolean encontrou = false;
        Integer posicaoachou=0;
        for (Ator a : lista) {
            //perguntar se o texto digitado é igual ao elemento da lista
            if (nome.equals(a.getNome())) {
                //atualiza posicao
                posicao = posicaoachou;
                encontrou = true;
                //exibir conteudo no formulario
                textNome.setText(a.getNome());
                break;
            }
            posicaoachou++;
        }
        if (encontrou == true) {
            JOptionPane.showMessageDialog(null, "Achou!");
        } else {
            JOptionPane.showMessageDialog(null, "Não Achou!");
        }
    }//GEN-LAST:event_bConsultarActionPerformed

    private void bStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bStatusActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_bStatusActionPerformed
    private void Limpar(){
        textNome.setText(null);
        textData.setText(null);
        textEmail.setText(null);
        textNomeArt.setText(null);
        selecaoEstado.setSelectedIndex(0);
        textCidade.setText(null);
        textBairro.setText(null);
        textEndereco.setText(null);
        textQtdNovela.setText(null);
        textSalario.setText(null);
        textCache.setText(null);
        textQtdEvento.setText(null);
        textGanhos.setText(null);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(InterfaceAtor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(InterfaceAtor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(InterfaceAtor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(InterfaceAtor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new InterfaceAtor().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bAnterior;
    private javax.swing.JButton bCadastrar;
    private javax.swing.JButton bConsultar;
    private javax.swing.JButton bExcluir;
    private javax.swing.JButton bPrimeiro;
    private javax.swing.JButton bProximo;
    private javax.swing.JButton bStatus;
    private javax.swing.JButton bUltimo;
    private javax.swing.JButton botaoLimpar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JComboBox selecaoEstado;
    private javax.swing.JTextField textBairro;
    private javax.swing.JTextField textCache;
    private javax.swing.JTextField textCidade;
    private javax.swing.JTextField textData;
    private javax.swing.JTextField textEmail;
    private javax.swing.JTextField textEndereco;
    private javax.swing.JLabel textGanhos;
    private javax.swing.JTextField textNome;
    private javax.swing.JTextField textNomeArt;
    private javax.swing.JTextField textQtdEvento;
    private javax.swing.JTextField textQtdNovela;
    private javax.swing.JTextField textSalario;
    // End of variables declaration//GEN-END:variables
}
